<!DOCTYPE html>
<html ng-app="myapp">
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="css/base.css"/>
		<link rel="stylesheet" type="text/css" href="css/collect.css"/>
		<link rel="stylesheet" type="text/css" href="font_a/iconfont.css"/>
		<script src="js/index.js"></script>
		<script src="js/rem.js"></script>
		<script src="js/angular.js"></script>
		<script src="js/angular-ui-router.js"></script>
		<title></title>
	</head>
	<body ng-controller="ctrl">
		<ui-view></ui-view>
		<div class="und"></div>
		<footer>
			<ul>
				<li>
					<a ui-sref="home.goods" ui-sref-active="style-home">
						<span class="iconfont icon-shouyexian"></span>
						<p>首页</p>
					</a>
				</li>	
				<li>
					<a ui-sref="classify" ui-sref-active="style-home">	
						<span class="iconfont icon-fenlei"></span>
						<p>分类</p>
					</a>
				</li>	
				<li>
					<a ui-sref="myself" ui-sref-active="style-home">	
					    <span class="iconfont icon-20150825tubiaolianxizhuanhuan03"></span> 
						<p>我</p>
					</a>
				</li>
			</ul>
		</footer>
	</body>
	<script>
		var app = angular.module("myapp",["ui.router"]);
		app.config(function ($stateProvider, $urlRouterProvider) {
			$stateProvider.state("home", {
				url: "/home",
				templateUrl: "html/home.html"
			}).state("classify", {
				url: "/classify",
				templateUrl: "html/classify.html"
			}).state("myself", {
				url: "/myself",
				templateUrl: "html/myself.html"
			}).state("home.goods", {
				url: "/home.goods",
				templateUrl: "html/goods.html",
				controller:"ctrl"
			}).state("home.collect", {
				url: "/home.collect",
				templateUrl: "html/collect.html",
				controller:"ctrl"
			}).state("myself.object", {
				url: "/myself.object",
				templateUrl: "html/object.html",
				controller:"ctrl"
			}).state("myself.nw", {
				url: "/myself.nw",
				templateUrl: "html/nw.html",
				controller:"ctrl"
			})
			
			$urlRouterProvider.otherwise("home/home.goods");
		})
		app.controller("ctrl",function  ($scope,$http) {
			$http.get("data.json").success(function (res) {
				$scope.obj = res.goods;
				$scope.obj1 = res.collect;
				$scope.obj2 = res.clasify;
				$scope.obj3 = res.ob;
				$scope.xian = function (index) {
				$scope.obj2[index].conceal = !$scope.obj2[index].conceal;
				}
			})
		})
	</script>
</html>
